﻿using System;
using System.Globalization;

namespace GeoAPI.CoordinateSystems
{
	[Serializable]
	public class ProjectionParameter
	{
		public ProjectionParameter(string name, double value)
		{
			this._Name = name;
			this._Value = value;
		}

		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				this._Name = value;
			}
		}

		public double Value
		{
			get
			{
				return this._Value;
			}
			set
			{
				this._Value = value;
			}
		}

		public string WKT
		{
			get
			{
				return string.Format(CultureInfo.InvariantCulture.NumberFormat, "PARAMETER[\"{0}\", {1}]", new object[]
				{
					this.Name,
					this.Value
				});
			}
		}

		public string XML
		{
			get
			{
				return string.Format(CultureInfo.InvariantCulture.NumberFormat, "<CS_ProjectionParameter Name=\"{0}\" Value=\"{1}\"/>", new object[]
				{
					this.Name,
					this.Value
				});
			}
		}

		public override string ToString()
		{
			return string.Format("ProjectionParameter '{0}': {1}", this.Name, this.Value);
		}

		private string _Name;

		private double _Value;
	}
}
